home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / gcc / gcc260utilsdoc.lha / gnu / man / man1 / date.1 < prev    next >
Encoding:
Text File  |  1994-07-26  |  5.8 KB  |  265 lines

  1.  
  2.  
  3.  
  4. DATE(1L)          Misc. Reference Manual Pages           DATE(1L)
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      date - print or set the system date and time
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ddddaaaatttteeee [-u] [-d datestr] [-s datestr] [--uct] [--universal] [-
  13.      - date=datestr]  [--set=datestr] [--help] [--version] [+FOR-
  14.      MAT] [MMDDhhmm[[CC]YY][.ss]]
  15.  
  16.  
  17. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      This manual page documents the GNU version  of  ddddaaaatttteeee.   ddddaaaatttteeee
  19.      with  no  arguments prints the current time and date (in the
  20.      format of the `%c' directive described below).  If given  an
  21.      argument  that starts with a `+', it prints the current time
  22.      and date in a format controlled by that argument, which  has
  23.      the   same  format  as  the  format  string  passed  to  the
  24.      `strftime' function.  Except for directives that start  with
  25.      `%', characters in that string are printed unchanged.
  26.  
  27.      The directives are:
  28.  
  29.      %    a literal %
  30.  
  31.      n    a newline
  32.  
  33.      t    a horizontal tab
  34.  
  35.      Time fields:
  36.  
  37.      %H   hour (00..23)
  38.  
  39.      %I   hour (01..12)
  40.  
  41.      %k   hour ( 0..23)
  42.  
  43.      %l   hour ( 1..12)
  44.  
  45.      %M   minute (00..59)
  46.  
  47.      %p   locale's AM or PM
  48.  
  49.      %r   time, 12-hour (hh:mm:ss [AP]M)
  50.  
  51.      %s   seconds since 00:00:00,  Jan  1,  1970  (a  nonstandard
  52.           extension)
  53.  
  54.      %S   second (00..61)
  55.  
  56.      %T   time, 24-hour (hh:mm:ss)
  57.  
  58.      %X   locale's time representation (%H:%M:%S)
  59.  
  60.  
  61.  
  62.  
  63. FSF             Last change: GNU Shell Utilities                1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. DATE(1L)          Misc. Reference Manual Pages           DATE(1L)
  71.  
  72.  
  73.  
  74.      %Z   time zone (e.g., EDT), or nothing if no  time  zone  is
  75.           determinable
  76.  
  77.      Date fields:
  78.  
  79.      %a   locale's abbreviated weekday name (Sun..Sat)
  80.  
  81.      %A   locale's   full   weekday   name,    variable    length
  82.           (Sunday..Saturday)
  83.  
  84.      %b   locale's abbreviated month name (Jan..Dec)
  85.  
  86.      %B   locale's   full    month    name,    variable    length
  87.           (January..December)
  88.  
  89.      %c   locale's date and time (Sat Nov 04 12:02:33 EST 1989)
  90.  
  91.      %d   day of month (01..31)
  92.  
  93.      %D   date (mm/dd/yy)
  94.  
  95.      %h   same as %b
  96.  
  97.      %j   day of year (001..366)
  98.  
  99.      %m   month (01..12)
  100.  
  101.      %U   week number of year with Sunday as first  day  of  week
  102.           (00..53)
  103.  
  104.      %w   day of week (0..6) with 0 corresponding to Sunday
  105.  
  106.      %W   week number of year with Monday as first  day  of  week
  107.           (00..53)
  108.  
  109.      %x   locale's date representation (mm/dd/yy)
  110.  
  111.      %y   last two digits of year (00..99)
  112.  
  113.      %Y   year (1970...)
  114.  
  115.      By default, ddddaaaatttteeee pads numeric fields with zeroes.  GNU  ddddaaaatttteeee
  116.      recognizes the following nonstandard numeric modifiers:
  117.  
  118.      -     (hyphen) do not pad the field
  119.  
  120.      _    (underscore) pad the field with spaces
  121.  
  122.      If given an argument that does not start with `+', ddddaaaatttteeee sets
  123.      the  system  clock  to  the  time and date specified by that
  124.      argument.  The argument must  consist  entirely  of  digits,
  125.      which have the following meaning:
  126.  
  127.  
  128.  
  129. FSF             Last change: GNU Shell Utilities                2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. DATE(1L)          Misc. Reference Manual Pages           DATE(1L)
  137.  
  138.  
  139.  
  140.      MM   month
  141.  
  142.      DD   day within month
  143.  
  144.      hh   hour
  145.  
  146.      mm   minute
  147.  
  148.      CC   first two digits of year (optional)
  149.  
  150.      YY   last two digits of year (optional)
  151.  
  152.      ss   second (optional)
  153.  
  154.      Only the superuser can set the system clock.
  155.  
  156.   OOOOPPPPTTTTIIIIOOOONNNNSSSS
  157.      -_d _d_a_t_e_s_t_r, --_d_a_t_e _d_a_t_e_s_t_r
  158.           Display the time and date specified in  _d_a_t_e_s_t_r,  which
  159.           can  be in almost any common format.  The display is in
  160.           the default output format, or if an  argument  starting
  161.           with  `+'  is given to ddddaaaatttteeee, in the format specified by
  162.           that argument.
  163.  
  164.      --_h_e_l_p
  165.           Print a usage message on standard output and exit  suc-
  166.           cessfully.
  167.  
  168.      -_s _d_a_t_e_s_t_r, --_s_e_t _d_a_t_e_s_t_r
  169.           Set the time and date  to  _d_a_t_e_s_t_r,  which  can  be  in
  170.           almost  any common format.  It can contain month names,
  171.           timezones, `am' and `pm', etc.
  172.  
  173.      -_u, --_u_n_i_v_e_r_s_a_l
  174.           Print or set the time and date in Universal Coordinated
  175.           Time  (also known as Greenwich Mean Time) instead of in
  176.           local (wall clock) time.
  177.  
  178.      --_v_e_r_s_i_o_n
  179.           Print version information on standard output then  exit
  180.           successfully.
  181.  
  182. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  183.      To print the date of the day before yesterday
  184.  
  185.           date --date '2 days ago'
  186.  
  187.      To print the date of the day three months and one day hence
  188.  
  189.           date --date '3 months 1 day'
  190.  
  191.  
  192.  
  193.  
  194.  
  195. FSF             Last change: GNU Shell Utilities                3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. DATE(1L)          Misc. Reference Manual Pages           DATE(1L)
  203.  
  204.  
  205.  
  206.      To print the day of year of Christmas in the current year
  207.  
  208.           date --date '25 Dec' +%j
  209.  
  210.      To print the current date in a  format  including  the  full
  211.      month name and the day of the month
  212.  
  213.           date '+%B %d'
  214.  
  215.      But this may not be what you want because for the first nine
  216.      days  of  the  month, the `%d' expands to a zero-padded two-
  217.      digit field, for example `date -d 1-may '+%B %d'' will print
  218.      `May 01'.
  219.  
  220.      To print the same date but  without  the  leading  zero  for
  221.      one-digit  days  of  month,  you can use the nonstandard `-'
  222.      modifier to suppress the padding altogether.
  223.  
  224.           date -d 1-may '+%B %-d'
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261. FSF             Last change: GNU Shell Utilities                4
  262.  
  263.  
  264.  
  265.